export interface IDeptTree {
  key: string;
  title: string;
  children?: IDeptTree[];
}

/** 用户列表 */
export interface IUserItem {
  id?: number;
  appCode: string;
  appName: string;
  userCode: string;
  userName: string;
  currentDeptCode: string;
  currentRoleCode: string;
  userStatus: {
    code: '0' | '1';
    name: string;
  };
  deptRoleRequests: {
    deptCode: string;
    deptName?: string;
    roleList: {
      roleCode: string;
      roleName?: string;
    }[];
  }[];
  hasDeletePerm: boolean;
}

/** 用户详情 */
export interface IUserDetail {
  id?: number;
  userCode?: string;
  userName?: string;
  mobile?: string;
  mainUnitName?: string;
  officeMobile?: string;
  deptNamePathList: string[];
  deptRoleRequests: {
    deletedIndex?: boolean;
    /** 部门编码 */
    deptCode: string;
    /** 部门名称 */
    deptName?: string;
    /** 当前用户是否有编辑权限 */
    hasPermFlag?: boolean;
    changeDept?: boolean;
    roleList: {
      roleCode: string;
      roleName?: string;
    }[];
  }[];
}

/** 角色列表 */
export interface IRoleItem {
  id: number;
  appCode: string;
  appName: string;
  roleCode: string;
  roleName: string;
  userNum: number;
  dataPerm: {
    code: string;
    name: string;
  };
  roleDesc: string;
  status: {
    code: string;
    name: string;
  };
  roleType: {
    code: string;
    name: string;
  };
  defaultUrlMenuId: number;
  gmtCreate: string;
  createNick?: string;
  gmtModified: string;
  modifierNick?: string;
  selectIds?: string;
  defaultFlag: boolean;
}
